home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SS0288.ZIP / SS0288_4.TXT < prev    next >
Text File  |  1992-06-01  |  32KB  |  784 lines

  1. 96H LNAMES--LIST OF NAMES RECORD
  2. ================================
  3.  
  4. Description
  5. -----------
  6.  
  7. The LNAMES record is a list of names that can be referenced by
  8. subsequent SEGDEF and GRPDEF records in the object module.
  9.  
  10. The names are ordered by occurrence and referenced by index from
  11. subsequent records. More than one LNAMES record may appear. The names
  12. themselves are used as segment, class, group, overlay, and selector
  13. names.
  14.  
  15. History
  16. -------
  17.  
  18. This record has not changed since the original Intel 8086 OMF
  19. specification.
  20.  
  21. Record Format
  22. -------------
  23.                                                         
  24.    1     2             1           <--String Length--> 1
  25.    96    Record        String      Name String         Checksum
  26.          Length        Length
  27.                                                         
  28.                      <-----------repeated----------->
  29.  
  30. Each name appears in <count, char> format, and a null name is valid.
  31. The character set is ASCII. Names can be up to 254 characters long.
  32.   
  33.   NOTE: Any LNAMES records in an object module must appear before the
  34.   records that refer to them. Because it does not refer to any other
  35.   type of object record, an LNAMES record usually appears near the
  36.   start of an object module.
  37.  
  38. Examples
  39. --------
  40.  
  41. The following LNAMES record contains the segment and class names
  42. specified in all three of the following full-segment definitions:
  43.    
  44.    _TEXT     SEGMENT byte public 'CODE'
  45.    _DATA     SEGMENT word public 'DATA'
  46.    _STACK    SEGMENT para public 'STACK'      
  47.  
  48. The LNAMES record is:
  49.  
  50.      0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F  
  51. 0000 96 25 00 00 04 43 4F 44 45 04 44 41 54 41 05 53 .%...CODE.DATA.S.
  52. 0010 54 41 43 4B 05 5F 44 41 54 41 06 5F 53 54 41 43 TACK._DATA._STAC
  53. 0020 4B 05 5F 54 45 58 54 8B                         K._TEXT.
  54.  
  55. Byte 00H contains 96H, indicating that this is an LNAMES record.
  56.  
  57. Bytes 01-02H contain 0025H, the length of the remainder of the record.
  58.  
  59. Byte 03H contains 00H, a zero-length name.
  60.  
  61. Byte 04H contains 04H, the length of the class name CODE, which is
  62. found in bytes 05-08H. Bytes 09-26H contain the class names DATA and
  63. STACK and the segment names _DATA, _STACK, and _TEXT, each preceded by
  64. 1 byte that gives its length.
  65.  
  66. Byte 27H contains the Checksum field, 8BH.
  67.  
  68.  
  69. 98H OR 99H SEGDEF--SEGMENT DEFINITION RECORD
  70. ============================================
  71.  
  72. Description
  73. -----------
  74.  
  75. The SEGDEF record describes a logical segment in an object module. It
  76. defines the segment's name, length, and alignment, and the way the
  77. segment can be combined with other logical segments at bind, link, or
  78. load time.
  79.  
  80. Object records that follow a SEGDEF record can refer to it to identify
  81. a particular segment. The SEGDEF records are ordered by occurrence,
  82. and are referenced by segment indexes (starting from 1) in subsequent
  83. records.
  84.  
  85. History
  86. -------
  87.  
  88. Record type 99H is new for LINK386: the Segment Length field is 32
  89. bits rather than 16 bits, there is one newly implemented alignment
  90. type (page alignment), the B bit flag of the ACBP byte indicates a
  91. segment of 4 GB, and the P bit flag of the ACBP byte is the
  92. Use16/Use32 flag.
  93.  
  94. Starting with version 2.4, LINK ignores the Overlay Name Index field.
  95. In versions 2.4 and later, command-line parameters to LINK, rather
  96. than information contained in object modules, determine the creation
  97. of run-time overlays.
  98.  
  99. The length does not include COMDAT records. If selected, their size is
  100. added.
  101.  
  102. Record Format
  103. -------------
  104.    
  105.    1      2        <variable>  2 or 4  1 or 2  1 or 2 1 or 2   1
  106.    98     Record   Segment     Segment Segment Class  Overlay  Checksum
  107.    or 99  Length   Attributes  Length  Name    Name   Name     
  108.                                        Index   Index  Index
  109.  
  110. Segment Attributes Field
  111. ------------------------
  112.  
  113. The Segment Attributes field is a variable-length field;
  114. its layout is:
  115.  
  116.   <-3 bits->  <-3 bits-> <-1 bit-> <-1 bit->  <-2 bytes-->  <--1 byte-->
  117.   A           C          B         P          Frame Number  Offset
  118.                                               <conditional> <conditional>
  119.  
  120. The fields have the following meanings:
  121.  
  122.    A     Alignment
  123.          
  124.          A 3-bit field that specifies the alignment required when
  125.          this program segment is placed within a logical segment.
  126.          Its values are:
  127.          
  128.            0    Absolute segment.
  129.                 
  130.            1    Relocatable, byte aligned.
  131.                 
  132.            2    Relocatable, word (2-byte, 16-bit) aligned.
  133.                 
  134.            3    Relocatable, paragraph (16-byte) aligned.
  135.                 
  136.            4    Relocatable, aligned on 256-byte boundary (a "page"
  137.                 in the original Intel specification).
  138.                 
  139.            5    Relocatable, aligned on a double word (4-byte)
  140.                 boundary. This value is used by the PharLap OMF for
  141.                 the same alignment.
  142.                 
  143.            6    This value is used by the PharLap OMF for page (4K)
  144.                 alignment. It is not supported by LINK.
  145.                 
  146.            7    Not defined.
  147.                 
  148.            The new values for LINK386 are A=4 and A=5. Double word
  149.            alignment is expected to be useful as 32-bit memory paths
  150.            become more prevalent. Page-align is useful for certain
  151.            hardware-defined items (such as page tables) and error
  152.            avoidance.
  153.            
  154.            If A=0, the conditional Frame Number and Offset fields
  155.            are present and indicate the starting address of the
  156.            absolute segment. LINK ignores the Offset field.
  157.            
  158.            Conflict: The original Intel specification included
  159.            additional segment-alignment values not supported by
  160.            Microsoft; alignment 5 now conflicts with the following
  161.            LINK386 extensions:
  162.            
  163.            5    "unnamed absolute portion of memory address space"
  164.                 
  165.            6    "load-time locatable (LTL), paragraph aligned if not
  166.                 part of any group"
  167.                 
  168.     C    Combination
  169.          
  170.          A 3-bit field that describes how the linker can combine the
  171.          segment with other segments. Under MS-DOS, segments with
  172.          the same name and class can be combined in two ways: they
  173.          can be concatenated to form one logical segment, or they
  174.          can be overlapped. In the latter case, they have either the
  175.          same starting address or the same ending address, and they
  176.          describe a common area in memory. Values for the C field
  177.          are:
  178.          
  179.            0    Private. Do not combine with any other program
  180.                 segment.
  181.                 
  182.            1    Reserved by IBM. Not supported by Microsoft.
  183.                 
  184.            2    Public. Combine by appending at an offset that meets
  185.                 the alignment requirement.
  186.                 
  187.            3    Reserved by IBM. Not supported by Microsoft.
  188.                 
  189.            4    As defined by Microsoft, same as C=2 (public).
  190.                 
  191.            5    Stack. Combine as for C=2. This combine type forces
  192.                 byte alignment.
  193.                 
  194.            6    Common. Combine by overlay using maximum size.
  195.                 
  196.            7    As defined by Microsoft, same as C=2 (public).
  197.                 
  198.            Conflict: The Intel specification lists C=1 as Common,
  199.            not C=6.
  200.  
  201.   B     Big
  202.         
  203.         Used as the high-order bit of the Segment Length field. If
  204.         this bit is set, the segment length value must be 0. If the
  205.         record type is 98H and this bit is set, the segment is
  206.         exactly 64K long. If the record type is 99H and this bit is
  207.         set, the segment is exactly 2^32 bytes, or 4 GB, long.
  208.         
  209.           NOTE: A problem in the 286 chip makes code unreliable if
  210.           it is executed between bytes 65,500 and 65,535. LINK
  211.           warns of this problem if code segments reach that size.
  212.         
  213.   P     This bit corresponds to the bit field for segment
  214.         descriptors, known as the B bit for data segments and the D
  215.         bit for code segments in the Intel documentation.
  216.         If 0, then the segment is no larger than 64K (if data), and
  217.         16-bit addressing and operands are the default (if code).
  218.         This is a Use16 segment.
  219.        
  220.         If nonzero, then the segment may be larger than 64K (if
  221.         data), and 32-bit addressing and operands are the default
  222.         (if code). This is a Use32 segment.
  223.         
  224.            NOTE: This is the only method for defining Use32 segments
  225.            in the Microsoft OMF. The PharLap OMF uses an additional
  226.            byte of bit flags at the end of the SEGDEF record to hold
  227.            this and other flags (described later in this section).
  228.            Even if the P bit is 0, the PharLap OMF assumes all
  229.            segments are Use32.
  230.   
  231. Segment Length Field
  232. --------------------
  233.  
  234. The Segment Length field is a 2- or 4-byte numeric quantity and
  235. specifies the number of bytes in this program segment. For record type
  236. 98H, the length can be from 0 to 64K; if a segment is exactly 64K, the
  237. segment length should be 0, and the B field in the ACBP byte should be
  238. 1. For record type 99H, the length can be from 0 to 4 GB; if a segment
  239. is exactly 4 GB in size, the segment length should be 0 and the B
  240. field in the ACBP byte should be 1.
  241.  
  242. Segment Name Index, Class Name Index, Overlay Name Index Fields
  243. ---------------------------------------------------------------
  244.  
  245. The three name indexes (Segment Name Index, Class Name Index, and
  246. Overlay Name Index) refer to names that appeared in previous LNAMES
  247. record(s). LINK ignores the Overlay Name Index field. The full name of
  248. a segment consists of the segment and class names, and segments in
  249. different object modules are normally combined according to the A and
  250. C values if their full names are identical. These indexes must be
  251. nonzero, although the name itself may be null.
  252.  
  253. The Segment Name Index field identifies the segment with a name. The
  254. name need not be unique--other segments of the same name will be
  255. concatenated onto the first segment with that name. The name may have
  256. been assigned by the programmer, or it may have been generated by a
  257. compiler.
  258.  
  259. The Class Name Index field identifies the segment with a class name
  260. (such as CODE, FAR_DATA, or STACK). The linker places segments with
  261. the same class name into a contiguous area of memory in the run-time
  262. memory map.
  263.  
  264. The Overlay Name Index field identifies the segment with a run-time
  265. overlay. It is ignored by current versions of the linker.
  266.  
  267. PharLap Extensions to This Record
  268. ---------------------------------
  269.  
  270. In the PharLap 32-bit OMF, there is an additional optional field that
  271. follows the Overlay Name Index field. The reserved bits should always
  272. be 0. The format of this field is
  273.  
  274.    <------------5 bits----------------> <--1 bit-->  <--2 bits-->
  275.    Reserved                             U            AT
  276.  
  277. where AT is the access type for the segment and has the following
  278. possible values
  279.    
  280.    0    Read only
  281.    1    Execute only
  282.    2    Execute/read
  283.    3    Read/write
  284.  
  285. and U is the Use16/Use32 bit for the segment and has the following
  286. possible values:
  287.    
  288.    0    Use16
  289.    1    Use32
  290.   
  291.   Conflicts: The Microsoft-defined OMF has Use16/Use32 stored as the P
  292.   bit of the ACBP field. Microsoft's OMF does not specify the access
  293.   for the segment--it is specified in the .DEF file given to LINK.
  294.   
  295.   NOTES
  296.   
  297.   LINK imposes a limit of 255 SEGDEF records per object module.
  298.   
  299.   Certain name/class combinations are reserved for use by CodeView and
  300.   have special significance to the linker: name $$TYPES with class
  301.   name DEBTYP, and $$SYMBOLS with class name DEBSYM. See Appendix 1
  302.   for more information.
  303.  
  304. Examples
  305. --------
  306.  
  307. The following examples of Microsoft assembler SEGMENT directives show
  308. the resulting values for the A field in the corresponding SEGDEF
  309. object record:
  310.    
  311.    aseg  SEGMENT at 400h              ; A = 0
  312.    bseg  SEGMENT byte public 'CODE'   ; A = 1
  313.    cseg  SEGMENT para stack 'STACK'   ; A = 3
  314.  
  315. The following examples of assembler SEGMENT directives show the
  316. resulting values for the C field in the corresponding SEGDEF object
  317. record:
  318.  
  319.    aseg  SEGMENT at 400H            ; C = 0
  320.    bseg  SEGMENT public 'DATA'      ; C = 2
  321.    cseg  SEGMENT stack 'STACK'      ; C = 5
  322.    dseg  SEGMENT common 'COMMON'    ; C = 6
  323.  
  324. In this first example, the segment is byte aligned:
  325.  
  326.         0   1  2  3  4  5  6  7  8  9  A  B  C  D E  F 
  327.    0000 98  07 00 28 11 00 07 02 01 1E                 ....(.....
  328.   
  329.  
  330. Byte 00H contains 98H, indicating that this is a SEGDEF record.
  331.  
  332. Bytes 01-02H contain 0007H, the length of the remainder of the record.
  333.  
  334. Byte 03H contains 28H (00101000B), the ACBP byte. Bits 7-5 (the A
  335. field) contain 1 (001B), indicating that this segment is relocatable
  336. and byte aligned. Bits 4-2 (the C field) contain 2 (010B), which
  337. represents a public combine type. (When this object module is linked,
  338. this segment will be concatenated with all other segments with the
  339. same name.) Bit 1 (the B field) is 0, indicating that this segment is
  340. smaller than 64K. Bit 0 (the P field) is ignored and should be 0, as
  341. it is here.
  342.  
  343. Bytes 04-05H contain 0011H, the size of the segment in bytes.
  344.  
  345. Bytes 06-08H index the list of names defined in the module's LNAMES
  346. record. Byte 06H (the Segment Name Index field) contains 07H, so the
  347. name of this segment is the seventh name in the LNAMES record. Byte
  348. 07H (the Class Name Index field) contains 02H, so the segment's class
  349. name is the second name in the LNAMES record. Byte 08H (the Overlay
  350. Name Index field) contains 1, a reference to the first name in the
  351. LNAMES record. (This name is usually null, as MS-DOS ignores it
  352. anyway.)
  353.  
  354. Byte 09H contains the Checksum field, 1EH.
  355.  
  356. The second SEGDEF record declares a word-aligned segment. It differs
  357. only slightly from the first.
  358.  
  359.      0  1  2  3  4  5  6  7  8  9  A B  C  D  E  F 
  360. 0000 98 07 00 48 0F 00 05 03 01 01                 .. H......
  361.  
  362. Bits 7-5 (the A field) of byte 03H (the ACBP byte) contain 2 (010B),
  363. indicating that this segment is relocatable and word aligned.
  364.  
  365. Bytes 04-05H contain the size of the segment, 000FH.
  366.  
  367. Byte 06H (the Segment Name Index field) contains 05H, which refers to
  368. the fifth name in the previous LNAMES record.
  369.  
  370. Byte 07H (the Class Name Index field) contains 03H, a reference to the
  371. third name in the LNAMES record.
  372.  
  373.  
  374. 9AH GRPDEF--GROUP DEFINITION RECORD
  375. ===================================
  376.  
  377. Description
  378. -----------
  379.  
  380. This record causes the program segments identified by SEGDEF records
  381. to be collected together (grouped). For OS/2, the segments are
  382. combined into a logical segment that is to be addressed through a
  383. single selector. For MS-DOS, the segments are combined within the same
  384. 64K frame in the run-time memory map.
  385.  
  386. History
  387. -------
  388.  
  389. The special group name "FLAT" was added for LINK386.
  390.  
  391. Record Format
  392. -------------
  393.    
  394.    1    2        1 or 2     1        1 or 2       1
  395.    9A   Record   Group Name FF       Segment      Checksum
  396.         Length   Index      Index    Definition   
  397.                             <-----repeated----->  
  398.  
  399. Group Name Field
  400. ----------------
  401.  
  402. The Group Name field is specified as an index into a previously
  403. defined LNAMES name and must be nonzero.
  404.  
  405. Groups from different object modules are combined if their names are
  406. identical.
  407.  
  408. Group Components
  409. ----------------
  410.  
  411. The group's components are segments, specified as indexes into
  412. previously defined SEGDEF records.
  413.  
  414. The first byte of each group component is a type field for the
  415. remainder of the component. LINK requires a type value of FFH and
  416. always assumes that the component contains a segment index value. See
  417. the "Notes" section below for other types defined by Intel.
  418.  
  419. The component fields are usually repeated so that all the segments
  420. constituting a group can be included in one GRPDEF record.
  421.   
  422.   NOTES
  423.   
  424.   LINK imposes a limit of 31 GRPDEF records in a single object module
  425.   and limits the total number of group definitions across all object
  426.   modules to 31.
  427.   
  428.   This record is frequently followed by a THREAD FIXUPP record.
  429.   
  430.   The most common group is DGROUP, which is used to group the default
  431.   data segments (_DATA, CONST, and _BSS).
  432.   
  433.   LINK does special handling of the pseudo-group name FLAT for LINK386
  434.   only. All address references to this group are made as offsets from
  435.   the Virtual Zero Address, which is the start of the memory image of
  436.   the executable.
  437.   
  438.   The additional group component types defined by Intel and the fields
  439.   that follow them are:
  440.   
  441.     FE   External Index
  442.     FD   Segment Name Index, Class Name Index, Overlay Name Index
  443.     FB   LTL Data field, Maximum Group Length, Group Length
  444.     FA   Frame Number, Offset
  445.     
  446.   None of these types is supported by LINK.
  447.  
  448. Examples
  449. --------
  450.  
  451. The example of a GRPDEF record below corresponds to the following
  452. assembler directive:
  453.    
  454.    tgroup GROUP seg1,seg2,seg3
  455.  
  456. The GRPDEF record is:
  457.  
  458.      0   1  2   3  4   5  6  7  8   9  A   B  C  D  E F   
  459. 0000 9A  08 00  06 FF  01 FF 02 FF  03 55                 .....U
  460.  
  461. Byte 00H contains 9AH, indicating that this is a GRPDEF record.
  462.  
  463. Bytes 01-02H contain 0008H, the length of the remainder of the record.
  464.  
  465. Byte 03H contains 06H, the Group Name Index field. In this instance,
  466. the index number refers to the sixth name in the previous LNAMES
  467. record in the object module. That name is the name of the group of
  468. segments defined in the remainder of the record.
  469.  
  470. Bytes 04-05H contain the first of three group component descriptor
  471. fields. Byte 04H contains the required 0FFH, indicating that the
  472. subsequent field is a segment index. Byte 05H contains 01H, a segment
  473. index that refers to the first SEGDEF record in the object module.
  474. This SEGDEF record declared the first of three segments in the group.
  475.  
  476. Bytes 06-07H represent the second group component descriptor, this one
  477. referring to the second SEGDEF record in the object module.
  478.  
  479. Similarly, bytes 08-09H are a group component descriptor field that
  480. references the third SEGDEF record.
  481.  
  482. Byte 0AH contains the Checksum field, 55H.
  483.  
  484.  
  485. 9CH OR 9DH FIXUPP--FIXUP RECORD
  486. ===============================
  487.  
  488. Description
  489. -----------
  490.  
  491. The FIXUPP record contains information that allows the linker to
  492. resolve (fix up) and eventually relocate references between object
  493. modules. FIXUPP records describe the LOCATION of each address value to
  494. be fixed up, the TARGET address to which the fixup refers, and the
  495. FRAME relative to which the address computation is performed.
  496.  
  497. History
  498. -------
  499.  
  500. Record type 9DH is new for LINK386; it has a Target Displacement field
  501. of 32 bits rather than 16 bits, and the Location field of the Locat
  502. word has been extended to 4 bits (using the previously unused higher
  503. order S bit) to allow new LOCATION values of 9, 11, and 13.
  504.  
  505. Record Format
  506. -------------
  507.    
  508.    1          2          <------from Record Length----->  1
  509.    9C         Record     THREAD subrecord or              Checksum
  510.    or 9D      Length     FIXUP subrecord                  
  511.                          <--------repeated------------->  
  512.  
  513. Each subrecord in a FIXUPP object record either defines a thread for
  514. subsequent use, or refers to a data location in the nearest previous
  515. LEDATA or LIDATA record. The high-order bit of the subrecord
  516. determines the subrecord type: if the high-order bit is 0, the
  517. subrecord is a THREAD subrecord; if the high-order bit is 1, the
  518. subrecord is a FIXUP subrecord. Subrecords of different types can be
  519. mixed within one object record.
  520.  
  521. Information that determines how to resolve a reference can be
  522. specified explicitly in a FIXUP subrecord, or it can be specified
  523. within a FIXUP subrecord by a reference to a previous THREAD
  524. subrecord. A THREAD subrecord describes only the method to be used by
  525. the linker to refer to a particular target or frame. Because the same
  526. THREAD subrecord can be referenced in several subsequent FIXUP
  527. subrecords, a FIXUPP object record that uses THREAD subrecords may be
  528. smaller than one in which THREAD subrecords are not used.
  529.  
  530. THREAD subrecords can be referenced in the same object record in which
  531. they appear and also in subsequent FIXUPP object records.
  532.  
  533. THREAD Subrecord
  534. ----------------
  535.  
  536. There are four FRAME threads and four TARGET threads; not all need be
  537. defined, and they can be redefined by later THREAD subrecords in the
  538. same or later FIXUPP object records. The FRAME threads are used to
  539. specify the Frame Datum field in a later FIXUP subrecord; the TARGET
  540. threads are used to specify the Target Datum field in a later FIXUP
  541. subrecord.
  542.  
  543. A THREAD subrecord does not require that a previous LEDATA or LIDATA
  544. record occur.
  545.  
  546. The layout of the THREAD subrecord is as follows:
  547.  
  548.    <--------------1 byte-------------------->  <---1 or 2 bytes--->
  549.    0      D       0      Method     Thred      Index
  550.    1      1       1      3          2 (bits)   <---conditional---->
  551.  
  552. where:
  553.  
  554.    0      The high-order bit is 0 to indicate that this is a THREAD
  555.           subrecord.
  556.           
  557.    D      Is 0 for a TARGET thread, 1 for a FRAME thread.
  558.           
  559.    Method Is a 3-bit field.
  560.       
  561.           For TARGET threads, only the lower two bits of the field
  562.           are used; the high-order bit of the method is derived from
  563.           the P bit in the Fix Data field of FIXUP subrecords that
  564.           refer to this thread. (The full list of methods is given
  565.           here for completeness.) This field determines the kind of
  566.           index required to specify the Target Datum field.
  567.           
  568.             T0   Specified by a SEGDEF index.
  569.                  
  570.             T1   Specified by a GRPDEF index.
  571.                  
  572.             T2   Specified by a EXTDEF index.
  573.                  
  574.             T3   Specified by an explicit frame number (not
  575.                  supported by LINK).
  576.                  
  577.             T4   Specified by a SEGDEF index only; the displacement
  578.                  in the FIXUP subrecord is assumed to be 0.
  579.                  
  580.             T5   Specified by a GRPDEF index only; the displacement
  581.                  in the FIXUP subrecord is assumed to be 0.
  582.                  
  583.             T6   Specified by a EXTDEF index only; the displacement
  584.                  in the FIXUP subrecord is assumed to be 0.
  585.                  
  586.                  The index type specified by the TARGET thread
  587.                  method is encoded in the Index field.
  588.                  
  589.                  For FRAME threads, the Method field determines the
  590.                  Frame Datum field of subsequent FIXUP subrecords
  591.                  that refer to this thread. Values for the Method
  592.                  field are:
  593.                  
  594.                     F0    The FRAME is specified by a SEGDEF index.
  595.                           
  596.                     F1    The FRAME is specified by a GRPDEF index.
  597.                           
  598.                     F2    The FRAME is specified by a EXTDEF index.
  599.                           LINK determines the FRAME from the external
  600.                           name's corresponding PUBDEF record in
  601.                           another object module, which specifies
  602.                           either a logical segment or a group.
  603.                           
  604.                     F3    Invalid. (The FRAME is identified by an
  605.                           explicit frame number; this is not
  606.                           supported by LINK.)
  607.                           
  608.                     F4    The FRAME is determined by the segment
  609.                           index of the previous LEDATA or LIDATA
  610.                           record (that is, the segment in which the
  611.                           location is defined).
  612.                           
  613.                     F5    The FRAME is determined by the TARGET's
  614.                           segment, group, or external index.
  615.                           
  616.                     F6    Invalid.
  617.                           
  618.                           NOTE: The Index field is present for FRAME
  619.                           methods F0, F1, and F2 only.
  620.                           
  621.    Thred  A 2-bit field that determines the thread number (0 through
  622.           3, for the four threads of each kind).
  623.    Index  A conditional field that contains an index value that
  624.           refers to a previous SEGDEF, GRPDEF, or EXTDEF record. The
  625.           field is present only if the thread method is 0, 1, or 2.
  626.           (If method 3 were supported by LINK, the Index field would
  627.           contain an explicit frame number.)
  628.  
  629. FIXUP Subrecord
  630. ---------------
  631.  
  632. A FIXUP subrecord gives the how/what/why/where/who information
  633. required to resolve or relocate a reference when program segments are
  634. combined or placed within logical segments. It applies to the nearest
  635. previous LEDATA or LIDATA record, which must be defined before the
  636. FIXUP subrecord. The FIXUP subrecord is as follows
  637.  
  638.    2      1               1 or 2         1 or 2          2 or 4
  639.    Locat  Fix             Frame          Target          Target
  640.           Data            Datum          Datum           Displacement
  641.           <conditional>   <conditional>  <conditional>   
  642.  
  643. where the Locat field has an unusual format. Contrary to the usual
  644. byte order in Intel data structures, the most significant bits of the
  645. Locat field are found in the low-order, rather than the high-order,
  646. byte
  647.    
  648.    <-----low-order byte----><----high-order byte--->
  649.    1    M   Location        Data Record Offset
  650.    1    1   4               10 (bits)
  651.  
  652. where:
  653.  
  654.    1          The high-order bit of the low-order byte is set to
  655.               indicate a FIXUP subrecord.
  656.               
  657.    M          Is the mode; M=1 for segment-relative fixups, and M=0
  658.               for self-relative fixups.
  659.               
  660.    Location   Is a 4-bit field that determines what type of LOCATION
  661.               is to be fixed up:
  662.               
  663.                 0    Low-order byte (8-bit displacement or low byte
  664.                      of 16-bit offset).
  665.                      
  666.                 1    16-bit offset.
  667.                      
  668.                 2    16-bit base--logical segment base (selector).
  669.                      
  670.                 3    32-bit Long pointer (16-bit base:16-bit
  671.                      offset).
  672.                      
  673.                 4    High-order byte (high byte of 16-bit offset).
  674.                      LINK does not support this type.
  675.                      
  676.                 5    16-bit loader-resolved offset, treated as
  677.                      Location=1 by the linker.
  678.                      
  679.                      Conflict: The PharLap OMF uses Location=5 to
  680.                      indicate a 32-bit offset, whereas Microsoft
  681.                      uses Location=9.
  682.                      
  683.                 6    Not defined, reserved.
  684.                     
  685.                        Conflict: The PharLap OMF uses Location=6 to
  686.                        indicate a 48-bit pointer (16-bit base:32-bit
  687.                        offset), whereas Microsoft uses Location=11.
  688.                     
  689.                 7    Not defined, reserved.
  690.                      
  691.                 9    32-bit offset.
  692.                      
  693.                 11   48-bit pointer (16-bit base:32-bit offset).
  694.                      
  695.                 13   32-bit loader-resolved offset, treated as
  696.                      Location=9 by the linker.
  697.                      
  698.    Data       Indicates the position of the LOCATION to be fixed up
  699.    Record     in the LEDATA or LIDATA record immediately preceding
  700.    Offset     the FIXUPP record. This offset indicates either a byte
  701.               in the Data Bytes field of an LEDATA record or a data
  702.               byte in the Content field of a Data Block field in an
  703.               LIDATA record.
  704.  
  705. The Fix Data bit layout is
  706.  
  707.    F    Frame  T    P    Targt
  708.    1    3      1    1    2 (bits)
  709.  
  710. and is interpreted as follows:
  711.  
  712.    F        If F=1, the FRAME is given by a FRAME thread whose
  713.             number is in the Frame field (modulo 4). There is no
  714.             Frame Datum field in the subrecord.
  715.             
  716.             If F=0, the FRAME method (in the range F0 to F5) is
  717.             explicitly defined in this FIXUP subrecord. The method
  718.             is stored in the Frame field.
  719.             
  720.    Frame    A 3-bit numeric field, interpreted according to the F
  721.             bit. The Frame Datum field is present and is an index
  722.             field for FRAME methods F0, F1, and F2 only.
  723.             
  724.    T        If T=1, the TARGET is defined by a TARGET thread whose
  725.             thread number is given in the 2-bit Targt field. The
  726.             Targt field contains a number between 0 and 3 that
  727.             refers to a previous THREAD subrecord containing the
  728.             TARGET method. The P bit, combined with the two low-
  729.             order bits of the Method field in the THREAD subrecord,
  730.             determines the TARGET method.
  731.             
  732.             If T=0, the TARGET is specified explicitly in this FIXUP
  733.             subrecord. In this case, the P bit and the Targt field
  734.             can be considered a 3-bit field analogous to the Frame
  735.             field.
  736.             
  737.    P        Determines whether the Target Displacement field is
  738.             present.
  739.             
  740.             If P=1, there is no Target Displacement field.
  741.             
  742.             If P=0, the Target Displacement field is present. It is
  743.             a 4-byte field if the record type is 9DH; it is a 2-byte
  744.             field otherwise.
  745.             
  746.    Targt    A 2-bit numeric field, which gives the lower two bits of
  747.             the TARGET method (if T=0) or gives the TARGET thread
  748.             number (if T=1).
  749.  
  750. Frame Datum, Target Datum, and Target Displacement Fields
  751. ---------------------------------------------------------
  752.  
  753. The Frame Datum field is an index field that refers to a previous
  754. SEGDEF, GRPDEF, or EXTDEF record, depending on the FRAME method.
  755.  
  756. Similarly, the Target Datum field contains a segment index, a group
  757. index, or an external name index, depending on the TARGET method.
  758.  
  759. The Target Displacement field, a 16-bit or 32-bit field, is present
  760. only if the P bit in the Fix Data field is set to 0, in which case the
  761. Target Displacement field contains the offset used in methods 0, 1,
  762. and 2 of specifying a TARGET.
  763.   
  764.   NOTES
  765.   
  766.   FIXUPP records are used to fix references in the immediately
  767.   preceding LEDATA, LIDATA, or COMDAT record.
  768.   
  769.   The Frame field is the translator's way of telling the linker the
  770.   contents of the segment register used for the reference; the TARGET
  771.   is the item being referenced whose address was not completely
  772.   resolved by the translator. In protected mode, the only legal
  773.   segment register values are selectors; every segment and group of
  774.   segments is mapped through some selector and addressed by an offset
  775.   within the underlying memory defined by that selector.
  776.  
  777. Examples
  778. --------
  779.  
  780. Due to the incredible length of the FIXUPP examples in "The MS-DOS
  781. Encyclopedia," they are not repeated here. However, the examples are
  782. highly recommended if you want to understand what is happening.
  783.  
  784.